<template>
    <view class="pub_page pub_document">
        <pub-head headerName="document" :headerConfig="headerConfig"></pub-head>
        <div class="page_box page_box_scroll" :style="{ 'height': `calc(100vh - ${headerHeight})` }">
            <div class="content_div" v-if="noticeInfo">
                <rich-text class="content" :nodes="noticeInfo.content"></rich-text>
            </div>
        </div>
    </view>
</template>

<script>
export default {
    data() {
        return {
            headerConfig: {
                title: '',//标题栏内容
            },
            headerHeight: getApp().globalData.headerHeight,

            noticeId: '',
            noticeInfo: ''
        };
    },
    onLoad(options) {
        // 支付宝小程序设置状态栏文字颜色
        this.$comFun.setZfbNavigationBar();

        this.noticeId = options.noticeId || 14;
        if (this.noticeId) {
            this.getNoticeInfo();
        }
    },
    methods: {
        async getNoticeInfo() {
            const res = await this.$request.get(`/mobile/user_center/getNoticeDetail/${this.noticeId}`, {});
            // console.log(res);
            if (res.code == 200) {
                this.noticeInfo = res.data;
                this.headerConfig.title = this.noticeInfo.title;
            }
        },
    },
};
</script>

<style lang="scss" scoped>
@import "@/common/css/mine.scss";
</style>
